package it.uniroma2.sd.db;

import java.io.Serializable;
import java.util.Vector;

public interface IColumnsGroup extends Serializable
{
    /**
     * 
     * @return the number of different columns
     */
    public int size();

    /* insert and update */
    /**
     * Add the IColumn passed as parameter to the IColumnsGroup.
     * 
     * @param column The new IColumn to add or to use for update
     */
    public void addColumn(IColumn column);

    /* get */
    /**
     * Retrieve the IColumn corresponding to the specified key.
     * 
     * @param columnkey The key for retrieving the IColumn.
     * @return The IColumn found or null if it does not exist in this IColumnsGroup.
     */
    public IColumn getColumn(String columnkeys);

    /**
     * Retrieve all the IColumns contained in this IColumnsGroup.
     * 
     * <p>
     * For each column key retrieve the IColumn and put it into a Vector. Since a row must contain at least one column the Vector will contain at least one element.
     * </p>
     * 
     * @param columnkey The key for retrieving the IColumn.
     * @return The Vector with the IColumns of this IColumnsGroup. (never null)
     */
    public Vector<IColumn> getAllColumns();

    /* delete */
    /**
     * Delete one column from this IColumnsGroup.
     * 
     * @param columnkey The key of the column to delete.
     * @return True if deletion succeeds, false if the column is not present in this IColumnsGroups.
     */
    public boolean deleteColumn(String columnkey);

    // private void createListAndAddColumn(Column column)

    // private void addFresherColumn(Column column)

}
